package com.yxinsur.imc.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxinsur.imc.business.domain.ImcOrder;
import com.yxinsur.imc.business.form.OrderSearchForm;
import com.yxinsur.imc.business.form.OrderSelfHoldForm;
import com.yxinsur.imc.business.form.ReportAdvanceForm;
import com.yxinsur.imc.business.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 保单Mapper接口
 *
 * @author imc
 * @date 2021-03-18
 */
@Mapper
public interface ImcOrderMapper extends BaseMapper<ImcOrder> {
    /**
     * 查询保单列表
     *
     * @param searchForm       查询条件
     * @param orderStatusCodes 保单状态
     * @param authOrgIds       权限部门id集合
     * @param tenantId         租户权限
     * @return
     */
    public List<OrderVo> selectImcOrderList(@Param("param") OrderSearchForm searchForm, @Param("orderStatusCodes") String orderStatusCodes, @Param("authOrgIds") String authOrgIds, @Param("tenantId") Long tenantId);

    /**
     * 查询个人业绩报表列表
     *
     * @return
     */
    public List<ReportAchievementVo> selectAchievementReportList(@Param("startDate1") Date startDate1, @Param("endDate1") Date endDate1,
                                                                 @Param("startDate2") Date startDate2, @Param("endDate2") Date endDate2,
                                                                 @Param("startDate3") Date startDate3, @Param("endDate3") Date endDate3,
                                                                 @Param("yearStartDate") Date yearStartDate, @Param("yearEndDate") Date yearEndDate,
                                                                 @Param("tenantId") Long tenantId);

    /**
     * 查询预收报表列表
     *
     * @return
     */
    public List<ReportAdvanceVo> selectAdvanceReportList(@Param("param") ReportAdvanceForm reportAdvanceForm, @Param("tenantId") Long tenantId);

    public List<ReportAdvanceExportVo> selectAdvanceReportExportList(@Param("param") ReportAdvanceForm reportAdvanceForm, @Param("tenantId") Long tenantId);

    /**
     * 指定年份指定分类查询保监报表新单业绩
     *
     * @return
     */
    public ReportInsCatalogVo selectOrderCatalogReportData(@Param("year") String year, @Param("depth") String depth, @Param("tenantId") Long tenantId);

    /**
     * 查询自保件
     *
     * @param orderSelfHoldForm
     * @return
     */
    List<OrderSelfHoldVo> selfHoldList(@Param("param") OrderSelfHoldForm orderSelfHoldForm, @Param("tenantId") Long tenantId);

    /**
     * 根据{保单号}查询保单
     *
     * @param policyCode 保单号
     * @param tenantId   租户权限
     * @return ImcOrder
     */
    ImcOrder getImcOrderByPolicyCode(@Param("policyCode") String policyCode, @Param("tenantId") Long tenantId);
}
